//
//  TYMenuListDefaultCell.m
//  TYUIKit
//
//  Created by TuyaInc on 2019/12/5.
//

#import "TYMenuListDefaultCell.h"

@implementation TYMenuListDefaultCellData

+ (instancetype)dataWithTitle:(NSString *)title image:(UIImage *)image {
    TYMenuListDefaultCellData *data = [TYMenuListDefaultCellData new];
    data.title = title;
    data.image = image;
    return data;
}

@end

@implementation TYMenuListDefaultCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
        
    }
    return self;
}

#pragma mark - <TYMenuListCellProtocol>
+ (CGFloat)menuCellHeightForData:(id)data {
    return 62;
}

- (void)setupMenuWithData:(TYMenuListDefaultCellData *)data {
    if ([data isKindOfClass:[TYMenuListDefaultCellData class]]) {
        self.textLabel.text = data.title;
        self.imageView.image = data.image;
    }
}

@end
